<%@ include file="../common/top.jsp" %>

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<link rel="StyleSheet" href="css/itemcard.css" type="text/css"
      media="screen"/>

<div id="Catalog">
    <h2>${sessionScope.product.name}</h2>
    <div class="item_card_groups">
        <div class="item_card_group">
            <c:forEach var="item" items="${sessionScope.itemList}">
                <div id="item">
                    <div class="item_card">
                        <div class="item_card_pic">
                            <div>
                                <img id="pic" src="${sessionScope.product.description}"/>
                            </div>
                        </div>
                        <div class="item_card_content">
                            <div>
                                <h4><a href="itemForm?itemId=${item.itemId}">${item.itemId}</a></h4>
                            </div>
                            <div class="item_card_description">
                                <div>
                                        ${item.product.productId}
                                    <div>
                                        ${item.attribute1}
                                    </div>
                                    <div>
                                        ${item.attribute2}
                                    </div>
                                        ${item.attribute3}
                                    <div>
                                        ${item.attribute4}
                                    </div>
                                        ${item.attribute5}
                                </div>
                                <div>
                                        ${sessionScope.product.name}</div>
                                <div>
                                    <fmt:formatNumber value="${item.listPrice}" pattern="$#,##0.00"/>
                                </div>
                                <br>
                                <br>
                                <div>
                                    <!--flag session和request的定义是避免刷新自增用的 -->
                                    <%session.setAttribute("flag", 1);%>
                                    <a href="addItemToCart?workingItemId=${item.itemId}&flag=1" class="Button">加入购物车</a>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </c:forEach>

        </div>
    </div>
</div>
<%--        <table>--%>
<%--            <tr>--%>
<%--                <th>Item ID</th>--%>
<%--                <th>Product ID</th>--%>
<%--                <th>Description</th>--%>
<%--                <th>List Price</th>--%>
<%--                <th>&nbsp;</th>--%>
<%--            </tr>--%>
<%--            <c:forEach var="item" items="${sessionScope.itemList}">--%>
<%--                <tr>--%>
<%--                    <td>--%>
<%--                        <a href="itemForm?itemId=${item.itemId}">${item.itemId}</a>--%>
<%--                    </td>--%>
<%--                    <td>${item.product.productId}</td>--%>
<%--                    <td>--%>
<%--                            ${item.attribute1} ${item.attribute2} ${item.attribute3}--%>
<%--                            ${item.attribute4} ${item.attribute5} ${sessionScope.product.name}--%>
<%--                    </td>--%>
<%--                    <td><fmt:formatNumber value="${item.listPrice}" pattern="$#,##0.00"/></td>--%>
<%--                    <td>--%>
<%--                        <!--flag session和request的定义是避免刷新自增用的 -->--%>
<%--                        <%--%>
<%--                            session.setAttribute("flag",1);--%>

<%--                        %>--%>
<%--                        <a href="addItemToCart?workingItemId=${item.itemId}&flag=1" class="Button" >Add to Cart</a>--%>

<%--                    </td>--%>
<%--                </tr>--%>
<%--            </c:forEach>--%>
<%--        </table>--%>

</div>

<%@ include file="../common/bottom.jsp" %>






